<?php
$guid = get_input('guid');
$activity = '';
if (!$guid || strlen($guid) == 0) {
	$activity = elgg_list_river(array(
			'base_url' => elgg_get_site_url()."ajax/view/river/elements/activity?guid=$guid"));
} else {
	$db_prefix = elgg_get_config('dbprefix');
	$activity = elgg_list_river(array(
		'joins' => array("JOIN {$db_prefix}entities e ON e.guid = rv.object_guid"),
		'wheres' => array("e.container_guid = $guid OR rv.object_guid = $guid"),
		'base_url' => elgg_get_site_url()."ajax/view/river/elements/activity?guid=$guid",
	));
}

if (!$activity || strlen($activity) == 0) {
	$activity = elgg_view('output/longtext', array('value' => elgg_echo('profile:activity:none')));
}
echo '<div>'.$activity.'</div>';